﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Tycho.Runtime;
using Tycho.Language;
using Tycho.Parser;
using Tycho.Transactions;

namespace TychoTest.Transactions {
    [TestClass]
    public class TestTransactionalObjectModule {
        TopLevel TopLevel;

        [TestInitialize]
        public void Initialize () {
            TopLevel = new TopLevel ();
        }

        [TestMethod]
        public void TestNewStructure () {
            AnyObject structure = TopLevel.Evaluate ("{a = 1, b = 2}");

            Assert.IsTrue (structure is TransactionalObject);
            Assert.AreEqual (1, structure.GetProperty (Modules.User.Get ("a")));
            Assert.AreEqual (2, structure.GetProperty (Modules.User.Get ("b")));
        }
    }
}
